import {DataTypes} from "sequelize";
import _gupiao_list from './model/gupiao_list.js';
import _gupiao from './model/gupiao.js';
import _gupiao_update from './model/gupiao_update.js';
import _user from './model/user.js';
import _blockchain_price from './model/blockchain_price.js';

// 自动生成mysql 然后返回函数生成的模型
function initModels(sequelize) {
  const gupiao_list = _gupiao_list(sequelize, DataTypes);
  const gupiao = _gupiao(sequelize, DataTypes);
  const gupiao_update = _gupiao_update(sequelize, DataTypes);
  const user = _user(sequelize, DataTypes);
  const blockchain_price = _blockchain_price(sequelize, DataTypes);

  gupiao_list.sync();
  gupiao.sync();
  gupiao_update.sync();
  user.sync();
  blockchain_price.sync();
  return {
    gupiao_update,
    gupiao,
    gupiao_list,
    user,
    blockchain_price
  };
}
export default initModels;
